<template>
  <header class="header w">
        <!-- logo -->
        <div class="logo">
            <h1>
                <button @click="goToApp">品优购商城</button>
            </h1>
        </div>
        <!-- 搜索框 -->
        <div class="search">
            <input type="search" name="" id="" placeholder="语言开发">
            <button>搜索</button>
        </div>
        <!-- 热点词 -->
        <div class="hotwords">
            <a href="#" class="style_red">优惠购首发</a>
            <a href="#">亿元优惠</a>
            <a href="#">9.9团购</a>
            <a href="#">每满99减30</a>
            <a href="#">办公用品</a>
            <a href="#">电脑</a>
            <a href="#">通信</a>
        </div>
        <!-- 购物车 -->
        <div class="shopcar">
            我的购物车
            <i class="counter">8</i>
        </div>
    </header>
</template>

<script>
export default {
name:'shopheader',
    methods:{
        goToApp(){
            this.$router.push('/app')
        }
    }
}
</script>

<style>
@font-face {
    font-family: 'icomoon';
    src: url('../fonts/icomoon.eot?tomleg');
    src: url('../fonts/icomoon.eot?tomleg#iefix') format('embedded-opentype'),
        url('../fonts/icomoon.ttf?tomleg') format('truetype'),
        url('../fonts/icomoon.woff?tomleg') format('woff'),
        url('../fonts/icomoon.svg?tomleg#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

.w {
    width: 1200px;
    margin: 0 auto;
}

.style_red {
    color: #c81623;
}

.current {
    background-color: #c81623;
}
.header {
    height: 105px;
    position: relative;
}

.logo {
    position: absolute;
    top: 25px;
    width: 171px;
    height: 61px;
}

.logo a {
    display: block;
    width: 171px;
    height: 61px;
    background: url(../images/logo.png) no-repeat;
    font-size: 0;
}

.search {
    position: absolute;
    left: 346px;
    top: 25px;
    width: 538px;
    height: 36px;
    border: 2px solid #b1191a;
}

.search input {
    float: left;
    width: 455px;
    height: 32px;
    padding-left: 10px;
}

.search button {
    float: left;
    width: 79px;
    height: 32px;
    background-color: #b1191a;
    color: #fff;
    font-size: 16px;
}

.hotwords {
    position: absolute;
    top: 66px;
    left: 346px;
}

.hotwords a {
    margin: 0 10px;
}

.shopcar {
    position: absolute;
    right: 60px;
    top: 25px;
    width: 140px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border: 1px solid #dfdfdf;
    background-color: #f7f7f7;
}

.shopcar::before {
    content: '\e93a';
    font-family: 'icomoon';
    color: #b1191a;
    margin-right: 5px;
}

.shopcar::after {
    content: '\e920';
    font-family: 'icomoon';
    margin-left: 10px;
}

.counter {
    position: absolute;
    top: -5px;
    left: 105px;
    height: 14px;
    background-color: #b1191a;
    color: #fff;
    line-height: 14px;
    padding: 0 5px;
    border-radius: 8px 8px 8px 0;
}

</style>